package br.com.basili.entity;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Embeddable
public class RelacaoProtocoloFasesID implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@ManyToOne(optional=false)
	@JoinColumn(name = "protocol_id")
	private Protocol protocol;

	@ManyToOne(optional=false)
	@JoinColumn(name = "identification_id")
	private Identification identification_id;
	
	@ManyToOne(optional=false)
	@JoinColumn(name = "introduction_id")
	private Introduction introduction_id;
	
	@ManyToOne(optional=false)
	@JoinColumn(name = "characterization_id")
	private Characterization characterization_id;
	
	@ManyToOne(optional=false)
	@JoinColumn(name = "definition_id")
	private Definition definition_id;
	
	@ManyToOne(optional=false)
	@JoinColumn(name = "planning_id")
	private Planning planning_id;

	public Identification getIdentification_id() {
		return identification_id;
	}

	public void setIdentification_id(Identification identification_id) {
		this.identification_id = identification_id;
	}

	public Introduction getIntroduction_id() {
		return introduction_id;
	}

	public void setIntroduction_id(Introduction introduction_id) {
		this.introduction_id = introduction_id;
	}

	public Characterization getCharacterization_id() {
		return characterization_id;
	}

	public void setCharacterization_id(Characterization characterization_id) {
		this.characterization_id = characterization_id;
	}

	public Definition getDefinition_id() {
		return definition_id;
	}

	public void setDefinition_id(Definition definition_id) {
		this.definition_id = definition_id;
	}

	public Planning getPlanning_id() {
		return planning_id;
	}

	public void setPlanning_id(Planning planning_id) {
		this.planning_id = planning_id;
	}

	public Protocol getProtocol() {
		return protocol;
	}

	public void setProtocol(Protocol protocol) {
		this.protocol = protocol;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime
				* result
				+ ((characterization_id == null) ? 0 : characterization_id
						.hashCode());
		result = prime * result
				+ ((definition_id == null) ? 0 : definition_id.hashCode());
		result = prime
				* result
				+ ((identification_id == null) ? 0 : identification_id
						.hashCode());
		result = prime * result
				+ ((introduction_id == null) ? 0 : introduction_id.hashCode());
		result = prime * result
				+ ((planning_id == null) ? 0 : planning_id.hashCode());
		result = prime * result
				+ ((protocol == null) ? 0 : protocol.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		RelacaoProtocoloFasesID other = (RelacaoProtocoloFasesID) obj;
		if (characterization_id == null) {
			if (other.characterization_id != null)
				return false;
		} else if (!characterization_id.equals(other.characterization_id))
			return false;
		if (definition_id == null) {
			if (other.definition_id != null)
				return false;
		} else if (!definition_id.equals(other.definition_id))
			return false;
		if (identification_id == null) {
			if (other.identification_id != null)
				return false;
		} else if (!identification_id.equals(other.identification_id))
			return false;
		if (introduction_id == null) {
			if (other.introduction_id != null)
				return false;
		} else if (!introduction_id.equals(other.introduction_id))
			return false;
		if (planning_id == null) {
			if (other.planning_id != null)
				return false;
		} else if (!planning_id.equals(other.planning_id))
			return false;
		if (protocol == null) {
			if (other.protocol != null)
				return false;
		} else if (!protocol.equals(other.protocol))
			return false;
		return true;
	}
	
	
	
}
